CSE 373: Data Structures and Algorithms

Winter 2000

Assignment 2 Chapter 3 Due January 14, 2000

 

Please include your name and student id # on what you turn in.

 

  1. Exercise 3.3 (3.2 in C++ book)
  2. Exercise 3.4 (3.9 in C++ book)
  3. Exercise 3.5 (3.10 in C++ book)
  4. Exercise 3.17 (3.20 in C++ book)
  5. Exercise 3.26 (3.28 in C++ book)

 

  1. Runtime stacks have certain properties.  They grow toward high memory or low memory (i.e., the top of the stack is at a higher address than the bottom of the stack or visa-versa) and they have a set bottom and a set ceiling.  Sometimes the runtime environment will grow the stack space if possible.  For example if a recursive program is runs out of stack space the runtime environment might try and add space to the top of the stack.  This is not always possible or practical.  Describe how you can write a program to determine which way the stack grows on your machine.  Also describe how you might add code to an existing program to determine how much runtime stack space a procedure is using.

 

  1. [Again not graded] How much time did you spend on this homework assignment?  On a scale from 1 to 10 (1 being way too easy, 5 being just about right, and 10 being way too hard) how would you rate this for a weekly homework assignment?